import {
    Home,
    Welcome,
    Star,
    Receive,
    Delete,
    Rubbish,
    Draft,
    Contact
  } from './Pages';
  
  
 const Raw = [
    {
      path: "/",
      exact: true,
      component: Home
    },
    {
      path: "/welcome",
      exact: true,
      component: Welcome
    },
    {
      path: '/contact',
      exact: true,
      component: Contact
    },
    {
      path: '/receive',
      icon: 'mail',
      title: '收件箱',
      withMenu: true,
      exact: true,
      component: Receive,
    },
    {
      path: '/star',
      icon: 'star',
      title: '星标邮件',
      withMenu: true,
      exact: true,
      component: Star,
    },
    {
      path: '/send',
      icon: 'inbox',
      title: '已发送',
      withMenu: true,
      exact: true,
      component: Star,
    },
    {
      path: '/draft',
      icon: 'file',
      title: '草稿箱',
      withMenu: true,
      exact: true,
      component: Draft,
    },
    {
      path: '/rubbish',
      icon: 'delete',
      title: '垃圾箱',
      withMenu: true,
      exact: true,
      component: Rubbish,
    },
    {
      path: '/delete',
      icon: 'close-circle',
      title: '已删除',
      withMenu: true,
      exact: true,
      component: Delete,
    },
  ]

  export const routes =  Raw.map((item) => {
      return {
          path: item.path,
          exact: item.exact,
          component: item.component
      }
  })

  export const menu = Raw.filter((item) => {
      return item.withMenu
  }).map((item) => {
      return {
          key: item.path,
          title: item.title,
          icon: item.icon
      }
  })
  console.log(menu)